#include <poll.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>

int main()
{
    struct pollfd fds = {0};
    int ret;

    fds.fd = open("/dev/scullpipe0", O_RDWR);
    if (fds.fd < 0) {
        printf("open fail.\n");
        return -1;
    }

    fds.events = POLLIN;
    ret = poll(&fds, 1, -1);

    printf("fds revent %d ret %d\n", fds.revents, ret);

    close(fds.fd);

    return 0;
}